#include "pch.hpp"
#include "Enums.hpp"
#include "Widgets.hpp"




Engine::Ui::Widgets::Type Engine::Ui::Widgets::parent(Type type)
{
	switch(type)
	{
	case Widget:         return None;
	case Text:           return Widget;         BOOST_STATIC_ASSERT((boost::is_base_of<Engine::Ui::Widget,         Engine::Ui::Text>::value) == true);
	case Frame:          return Widget;         BOOST_STATIC_ASSERT((boost::is_base_of<Engine::Ui::Widget,         Engine::Ui::Frame>::value) == true);
	case Window:         return Frame;          BOOST_STATIC_ASSERT((boost::is_base_of<Engine::Ui::Frame,          Engine::Ui::Window>::value) == true);
	case LineEdit:       return Frame;          //BOOST_STATIC_ASSERT((boost::is_base_of<Engine::Ui::Frame,          Engine::Ui::LineEdit>::value) == true);
	case AbstractButton: return Frame;          //BOOST_STATIC_ASSERT((boost::is_base_of<Engine::Ui::Frame,          Engine::Ui::AbstractButton>::value) == true);
	case PushButton:     return AbstractButton; //BOOST_STATIC_ASSERT((boost::is_base_of<Engine::Ui::AbstractButton, Engine::Ui::PushButton>::value) == true);
	case ProgressBar:    return Frame;          //BOOST_STATIC_ASSERT((boost::is_base_of<Engine::Ui::Frame,          Engine::Ui::ProgressBar>::value) == true);
	case Console:        return Widget;         //BOOST_STATIC_ASSERT((boost::is_base_of<Engine::Ui::Widget,         Engine::Ui::Console>::value) == true);
	case Desktop:        return Widget;         //BOOST_STATIC_ASSERT((boost::is_base_of<Engine::Ui::Widget,         Engine::Ui::Desktop>::value) == true);
	case Dialog:         return Window;         //BOOST_STATIC_ASSERT((boost::is_base_of<Engine::Ui::Window,         Engine::Ui::Dialog>::value) == true);
	default: BOOSTEXT_THROW(invalid_value_exception(type));
	}
}
///////////////////////////////////////////////////////////////////////////////////////////////////
